import CommonApi from './common'
import { uploadFileTimeout } from '@/config/settings'
// 公路状况评定
class StatusAssessApi extends CommonApi {
    constructor() {
        const scope = '/roadEvaluateBase'
        super(scope)
    }

    // 获取状况评定模板
    getExcel() {
        const path = this.resolvePath('/getExcelUrl')
        return this.post(path)
    }

    detail(data) {
        const path = this.resolvePath('/detailsByNumber')
        return this.post(path, data)
    }

    delete(data) {
        const path = this.resolvePath('/deleteByNumber')
        return this.post(path, data)
    }

    // 导入文件
    importExcel(form) {
        const headers = { 'content-type': 'multipart/form-data' }
        const path = this.resolvePath('/importExcel')
        return this.post(path, form, {
            headers,
            timeout: uploadFileTimeout
        })
    }

    // 路况评定数据管理-附件上传
    attachmentUpload(data) {
        const path = '/appendix/saveOrUpdate'
        return this.post(path, data)
    }

    // 路况评定数据管理-附件上传详情
    getDetailsByNumber(data) {
        const path = '/roadEvaluateBase/detailsByNumber'
        return this.post(path, data)
    }
}

export default StatusAssessApi
